package CinemaDevelop;
import java.time.LocalDateTime;
import java.util.List;
import java.util.LinkedList;

public abstract class User {
    protected String userName;
    protected String passWord;
    protected String telephoneNum;
    protected boolean isLogged = false;
    protected List<User> subUsers = new LinkedList<>();

    public User(String userName, String passWord, String telephoneNum) {
        this.userName = userName;
        this.passWord = passWord;
        this.telephoneNum = telephoneNum;
    }

    public abstract void login(String userName, String passWord);

    public void logout() {
        isLogged = false;
        System.out.println("登出成功！");
    }

    public void initialize() {
        userName = "";
        passWord = "";
        isLogged = false;
    }

    public List<User> getSubUsers() {
        return subUsers;
    }

    public abstract void setScreenRoom(Cinema cinema, ScreenRoom room);
    public abstract void addMovie(Cinema cinema, MovieSchedule schedule);
    public abstract void removeMovie(Cinema cinema, MovieSchedule schedule);
    public abstract void showMovieCasted(Cinema cinema);
    public abstract void findMovie(Cinema cinema, String movieName, String roomType);
    public abstract void sellTicket(Cinema cinema, String movieName, String roomType,
                                    LocalDateTime time, int row, int line, String inform);
}
